local skynet     = require "skynet"
local bewater    = require "bw.bewater"
local http_agent = require "bw.server.http_agent"
local sname      = require "sname"
local Passport   = bewater.proxy(sname.PASSPORT)

local M = {
    url = "/center/user/authorization",
    data = {
        acc = "string",
    },
}

function M.handler(_, data)
    local acc = data.acc
    return {
        authorization = Passport.get_passport(acc) or Passport.create(acc)
    }
end

http_agent.reg(M)
